hysop.topology.topology_descriptor module

class hysop.topology.topology_descriptor.TopologyDescriptor(mpi_params, domain, backend, **kwds)[source]

Bases: object

Describes how a topology should be built.

Multiple compatible topology descriptors are gathered during operator graph building and are replaced by a single unique topology upon initialization.

Initialize a TopologyDescriptor.

Notes

kwds allows for backend specific variables. CartesianTopologyDescriptor is immutable.

property backend

Get backend.

static build_descriptor(backend, operator, field, handle, **kwds)[source]

Generate a descriptor from a lower level representation. If handle is already a Topology or a TopologyDescriptor it is returned unchanged.

If handle is a CartesianTopologyDescriptors (ie. currently a Discretization), a CartesianTopologyDescriptor is created and returned.

Every new topology type should be registered here.

choose_or_create_topology(known_topologies, **kwds)[source]

Returns a topology that is either taken from known_topologies, a set of user specified topologies which are ensured to be compatible with the current TopologyDescriptor, or created from the descriptor if choose_topology() returns None.

abstract choose_topology(known_topologies, **kwds)[source]

Find optimal topology parameters from known_topologies. If None is returned, create_topology will be called instead.

abstract create_topology(**kwds)[source]

Build a topology with the current TopologyDescriptor.

property dim

Get domain dimension.

property domain

Get domain.

property extra_kwds

Get extra keyword arguments.

match(other, invert=False)[source]

Test if this descriptor is equivalent to the other one.

property mpi_params

Get mpi parameters.

hysop.topology.topology_descriptor.TopologyDescriptors = (<class 'hysop.topology.topology.Topology'>, <class 'hysop.topology.topology_descriptor.TopologyDescriptor'>, <class 'NoneType'>)

Instance of those types can be used to create a TopologyDescriptor. Thus they can be passed in the variables of each operator.